package com.zx.callback.common.enums;

/**
 *@table p_coupon_info.used_scope
 * 使用范围（0全平台 1购票 2购物）
 * @author ：yanst
 * @since: 2017/11/24
 * @history：(date editor desc)
 */
public enum UsedScopeEnum {

    ALL_PLATFORM((byte)0, "全平台"),
    BUY_TICKET((byte)1, "购票"),
    BUY_SHOP((byte)2, "购物"),
    ;
    UsedScopeEnum(byte key, String value) {
        this.key = key;
        this.value = value;
    }

    public static boolean contains(Byte key) {
        if (key != null) {
            for (UsedScopeEnum e : UsedScopeEnum.values()) {
                if (e.getKey().byteValue() == key) {
                    return true;
                }
            }
        }
        return false;
    }

    private Byte key;

    private String value;

    public Byte getKey() {
        return key;
    }

    public void setKey(Byte key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
